<!--
  运营-招聘管理-【招聘职位】
 -->
<template>
  <div class="news-container">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="已发布" name="1">
        <Pushed ref="studentMsg" />
      </el-tab-pane>
      <el-tab-pane label="未发布" name="2">
        <NoPushed ref="msgType" />
      </el-tab-pane>
      <el-tab-pane label="回收站" name="3">
        <RecycleBin ref="recycleBin" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import { searchConfig, tableConfig } from './initData'
import Pushed from './pushed.vue'
import NoPushed from './noPushed.vue'
import RecycleBin from './recycleBin'

export default {
  name: 'ProjectListCompany',
  components: {
    Pushed,
    NoPushed,
    RecycleBin
  },
  data() {
    return {
      searchConfig,
      tableConfig,
      tableData: [
        {
          id: '01',
          title: '这是测试标题'
        }
      ],
      total: 0,
      page: 0,
      limit: 0,
      tableSelectList: [],
      activeName: '1'
    }
  },
  created() {
  },
  mounted() {
    this.$refs.studentMsg && this.$refs.studentMsg.handleSearch()
  },
  methods: {
    handleClick(data) {
      const refEnum = {
        '1': 'studentMsg',
        '2': 'msgType',
        '3': 'recycleBin'
      }
      this.$refs[refEnum[this.activeName]] && this.$refs[refEnum[this.activeName]].handleSearch()
    }
  }
}
</script>

<style lang="scss">
  .projectList-yunying {
    .basic-table {
      .el-table__body-wrapper {
        height: calc(100vh - 271px);
      }
    }
    .basic-table::before {
      height: 0;
    }

    .pagination-container {
      padding: 0 !important;
    }
  }
  .projectList-yunying.nopush {
    .basic-table {
      .el-table__body-wrapper {
        height: calc(100vh - 289px);
      }
    }
  }
  .projectList-yunying.push {
    .basic-table {
      .el-table__body-wrapper {
        height: calc(100vh - 271px);
      }
    }
  }
  .projectList-yunying.recycleBin {
    .basic-table {
      .el-table__body-wrapper {
        height: calc(100vh - 256px);
      }
    }
  }
  </style>

<style lang="scss" scoped>
  .news-container {

    .header {
      display: flex;
      justify-content: space-between;
    }
  }
</style>
